package com.fau.cm.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Transient;

import org.apache.commons.lang.time.DateFormatUtils;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 电话统计类
 * @author dangjh
 * @datetime 2014年11月29日 上午12:39:07
 */
public class MedicalDailyCallSta implements Serializable, JSONAware {

	private static final long serialVersionUID = -52059204213627232L;

	private String groupName;
	private String userName;
	private String name;
	private Integer outGoingCalls;
	private Integer outGoingTime;
	private Integer effectiveCalls;
	private Integer effectiveTime;
	
	private String hospitalId;
	private String groupId;
	private String centerId;
	private Date startTime;
	private Date endTime;
	
	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getOutGoingCalls() {
		return outGoingCalls;
	}

	public void setOutGoingCalls(Integer outGoingCalls) {
		this.outGoingCalls = outGoingCalls;
	}

	public Integer getOutGoingTime() {
		return outGoingTime;
	}

	public void setOutGoingTime(Integer outGoingTime) {
		this.outGoingTime = outGoingTime;
	}

	public Integer getEffectiveCalls() {
		return effectiveCalls;
	}

	public void setEffectiveCalls(Integer effectiveCalls) {
		this.effectiveCalls = effectiveCalls;
	}

	public Integer getEffectiveTime() {
		return effectiveTime;
	}

	public void setEffectiveTime(Integer effectiveTime) {
		this.effectiveTime = effectiveTime;
	}

	public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}

	@Transient
	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	@Transient
	public String getCenterId() {
		return centerId;
	}

	public void setCenterId(String centerId) {
		this.centerId = centerId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("groupName", groupName);
		obj.put("userName", userName);
		obj.put("name", name);
		obj.put("outGoingCalls", outGoingCalls);
		obj.put("outGoingTime", outGoingTime);
		obj.put("effectiveCalls", effectiveCalls);
		obj.put("effectiveTime", effectiveTime);
		if(null != startTime) {
			obj.put("startTime", DateFormatUtils.format(startTime, "yyyy-MM-dd HH:mm:ss"));
		}
		if(null != endTime) {
			obj.put("endTime", DateFormatUtils.format(endTime, "yyyy-MM-dd HH:mm:ss"));
		}
		return obj.toJSONString();
	}

}
